import request from '../utils/request';//导入帮助类里面的request对象，帮助我们发送请求给后端api接口

//菜单树型
export const getMenuTree = query => {
    return request({
        url: '/api/Menu/Tree',
        method: 'get',//get请求用params
    });
};
//菜单列表（菜单显示查询）
export const getMenuList = query => {
    return request({
        url: '/api/Menu',
        method: 'get',//get请求用params
        params: query
    });
};

//菜单添加
export const AddMenu = query => {
    return request({
        url: '/api/Menu',
        method: 'post',//post请求用data
        data: query
    });
};
//菜单删除(单删)
export const DeleteMenu = query => {
    return request({
        url: '/api/Menu?id='+query,
        method: 'delete',
    });
};
//菜单删除（批删）
export const AllDeleteMenu = query => {
    return request({
        url: '/api/Menu/all',
        method: 'delete',
        data:query,
    });
};
//菜单根据Id查找数据
export const QueryIdMenu = query => {
    return request({
        url: '/api/Menu/id?id='+query,
        method: 'get',
    });
};
//菜单修改
export const UpdateMenu = query => {
    return request({
        url: '/api/Menu',
        method: 'put',
        data: query
    });
};


